/**
 * Created with Intellij IDEA.
 * Description:
 * User:Lenovo
 * Date:2024-12-05
 * Time:20:08
 */
public class Computer {

    public void powerOn() {
        System.out.println("开机");
    }

    public void powerOff() {
        System.out.println("关机");
    }
    public void UseDevice(USB usb){
        usb.OpenDevice();
        if(usb instanceof KeyBoard){
            KeyBoard keyBoard = (KeyBoard)usb;
            keyBoard.Input();
        }else if(usb instanceof Mouse){
            Mouse mouse = (Mouse)usb;
            mouse.Click();
        }
        usb.CloseDevice();
    }
}
